package com.tinem.platform.module.starter.jpa.entity.client;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className ClientChannelDetails
 * @description 客户度渠道信息表
 * @site
 * @company
 * @create 2021-10-29
 */
@Data
@Entity
@ToString
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name="t_client_channel_details")
@ApiModel("客户度渠道信息表")
public class ClientChannelDetails implements Serializable,Cloneable{
    @Id
    @Column(name = "c_cliet_id",nullable=true)
    @ApiModelProperty(name = "clietId", value = "客户端id;主键,必须唯一,不能为空.用于唯一标识每一个客户端(client); 在注册时必须填写(也可由服务端自动生成).对于不同的grant_type,该字段都是必须的. 在实际应用中的另一个名称叫appKey,与client_id是同一个概念.",required = true)
    private String clietId;

    @Column(name = "c_client_name",nullable=true)
    @ApiModelProperty(name = "clientName", value = "客户端名称",required = true)
    private String clientName;

    @Column(name = "c_resource_ids",nullable=true)
    @ApiModelProperty(name = "resourceIds", value = "资源id",required = true)
    private String resourceIds;

    @Column(name = "c_client_secret",nullable=true)
    @ApiModelProperty(name = "clientSecret", value = "客户端访问证书;",required = true)
    private String clientSecret;

    @Column(name = "c_scope",nullable=true)
    @ApiModelProperty(name = "scope", value = "范围",required = true)
    private String scope;

    @Column(name = "c_authorized_grant_types",nullable=true)
    @ApiModelProperty(name = "authorizedGrantTypes", value = "授权方式;",required = true)
    private String authorizedGrantTypes;

    @Column(name = "c_web_server_redirect_uri",nullable=true)
    @ApiModelProperty(name = "webServerRedirectUri", value = "返回地址",required = true)
    private String webServerRedirectUri;

    @Column(name = "c_authorities",nullable=true)
    @ApiModelProperty(name = "authorities", value = "权限",required = true)
    private String authorities;

    @Column(name = "c_access_token_validity",nullable=true)
    @ApiModelProperty(name = "accessTokenValidity", value = "访问token有效期",required = true)
    private Integer accessTokenValidity;

    @Column(name = "c_refresh_token_validity",nullable=true)
    @ApiModelProperty(name = "refreshTokenValidity", value = "刷新token有效期",required = true)
    private Integer refreshTokenValidity;

    @Column(name = "c_additional_information",nullable=false)
    @ApiModelProperty(name = "additionalInformation", value = "预留字段",required = false)
    private String additionalInformation;

    @Column(name = "c_autoapprove",nullable=true)
    @ApiModelProperty(name = "autoapprove", value = "自动授权",required = true)
    private String autoapprove;
    @Version
    @Column(name = "c_revision",nullable=true)
    @ApiModelProperty(name = "revision", value = "乐观锁",required = false)
    private Integer revision;

    @Column(name = "c_created_by",nullable=true)
    @ApiModelProperty(name = "createdBy", value = "创建人",required = false)
    private String createdBy;

    @Column(name = "c_created_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "createdTime", value = "创建时间",required = false)
    private Date createdTime;

    @Column(name = "c_updated_by",nullable=true)
    @ApiModelProperty(name = "updatedBy", value = "更新人",required = false)
    private String updatedBy;

    @Column(name = "c_updated_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "updatedTime", value = "更新时间",required = false)
    private Date updatedTime;
 }